# 引入time包
import time
# 引入threading包
import threading

def print_hello(index):
    time.sleep(3)  # 休眠3秒
    print('线程任务：hello({}) '.format(index))
    print('线程id:{}'.format(threading.current_thread().ident))
    print('线程名:{}'.format(threading.current_thread().name))
    print('线程状态:{}'.format(threading.current_thread().is_alive()))
    print('线程daemon:{}'.format(threading.current_thread().daemon))


if __name__ == '__main__':
    # t = threading.Thread(target=print_hello, args=(1,)) # 创建线程对象
    t = threading.Thread(target=print_hello, kwargs={"index": 1}) # 创建线程对象
    t.start()

    print("主线程执行结束。。。")